<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/admin/css/pintuer.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/admin/css/admin.css">
    <script src="${pageContext.request.contextPath}/admin/js/jquery.js"></script>
    <script src="${pageContext.request.contextPath}/admin/js/pintuer.js"></script>  
</head>
<body>
<div class="panel admin-panel margin-top">
  <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span> 修改个人信息</strong></div>
  <div class="body-content">
    <form class="form-x">        
      <div class="form-group">
        <div class="label">
          <label>用户昵称：</label>
        </div>
        <div class="field">
          <input id="aliasName" type="text" class="input w60"  name="aliasName" value="" />
          <div class="tips"></div>
        </div>
      </div>        
      <div class="form-group">
        <div class="label">
          <label>真实姓名：</label>
        </div>
        <div class="field">
          <input id="realName" type="text" class="input w60"  name="realName" value=""/>         
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>电子邮箱：</label>
        </div>
        <div class="field">
          <input id="email" type="text" class="input  w60"  name="email" value=""/>         
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>QQ：</label>
        </div>
        <div class="field">
          <input id="qq" type="text" class="input w60" name="qq" value=""/>        
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>微信：</label>
        </div>
        <div class="field">
          <input id="weiChat" type="text" class="input w60" name="wechat" value=""/>        
        </div>
      </div>
       <div class="form-group">
        <div class="label">
          <label>联系方式：</label>
        </div>
        <div class="field">
          <input id="telephone" type="text" class="input w60" name="telephone" value=""/>        
        </div>
      </div>
       <div class="form-group">
        <div class="label">
          <label>个人描述：</label>
        </div>
        <div class="field">
          <input id="remark" type="text" class="input" name="telephone" style="height:120px" value=""/>        
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
         	<div class="field">
          <button class="button bg-main icon-check-square-o" type="button" onclick="doChangeInfo()"> 确认修改</button>
        </div>
      </div>
    </form>
  </div>
</div>
</body>
<script type="text/javascript">

//执行操作加载服务
$(function (){
	//执行ajax操作
	$.ajax({
	 	type:'post',
	 	url:'${pageContext.request.contextPath}/userInfo/loadUserInfoData',
	 	data:{},
	 	dataType:'json',
	 	cache:false,
	 	success:function(data)
	 	{	
	 		if(data.success)
	 		{
	 			$("#aliasName").val(data.entity.aliasName);
	 			$("#realName").val(data.entity.realName);
	 			$("#qq").val(data.entity.qq);
	 			$("#telephone").val(data.entity.telephone);
	 			$("#weiChat").val(data.entity.weiChat);
	 			$("#email").val(data.entity.email);
	 			$("#remark").val(data.entity.remark);
	 		}
	 		else
	 		{
	 			alert(data.message);
	 		}
	 	},
	 	error:function(data)
	 	{
	 		alert('系统出现异常!');
	 	}
	});
});

//加载执行登录操作
function doChangeInfo(){
	//执行ajax操作
	$.ajax({
	 	type:'post',
	 	url:'${pageContext.request.contextPath}/userInfo/doChangeUserInfoData',
	 	data:{
	 		  "aliasName":$("#aliasName").val(),
	 		  "realName":$("#realName").val(),
	 		  "qq":$("#qq").val(),
	 		  "telephone":$("#telephone").val(),
	 		  "weiChat":$("#weiChat").val(),
	 		  "email":$("#email").val(),
	 		  "remark":$("#remark").val()
	 		 },
	 	dataType:'json',
	 	cache:false,
	 	success:function(data)
	 	{	
	 		if(data.success)
	 		{
	 			alert(data.message);
	 		}
	 		else
	 		{
	 			alert(data.message);
	 		}
	 	},
	 	error:function(data)
	 	{
	 		alert('系统出现异常!');
	 	}
	});
}
</script>	
</html>